allow hal_fingerprint_default vendor_fingerprint_data_file:dir rw_dir_perms;
allow hal_fingerprint_default vendor_fingerprint_data_file:file create_file_perms;

allow hal_fingerprint_default {
  input_device
  tee_device
  uhid_device
  vendor_fingerprint_device
  vendor_dmabuf_qseecom_heap_device
  vendor_dmabuf_qseecom_ta_heap_device
}: chr_file rw_file_perms;

allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl;

allow hal_fingerprint_default {
  input_device
  sysfs_rtc
  sysfs_wakeup
  vendor_sysfs_graphics
  vendor_sysfs_fingerprint
  vendor_sysfs_spss
}: dir r_dir_perms;

allow hal_fingerprint_default {
  sysfs_rtc
  sysfs_wakeup
  vendor_sysfs_fingerprint
  vendor_sysfs_graphics
  vendor_sysfs_spss
}: file rw_file_perms;

allow hal_fingerprint_default self:capability sys_nice;

allow hal_fingerprint_default hal_xiaomi_fingerprint_hwservice:hwservice_manager { add find };

allow hal_fingerprint_default vendor_hal_perf_hwservice:hwservice_manager find;

binder_call(hal_fingerprint_default, vendor_hal_perf_default)

r_dir_file(hal_fingerprint_default, firmware_file)

set_prop(hal_fingerprint_default, vendor_fp_prop)

get_prop(system_server, vendor_fp_prop);

# Binder
allow hal_fingerprint_default vendor_hal_perf_default:binder call;

# Props
set_prop(hal_fingerprint_default, vendor_fingerprint_prop)
get_prop(system_server, vendor_fingerprint_prop);

allow hal_fingerprint_default sysfs:file  { write };
allow hal_fingerprint_default rootfs:dir { read };
